﻿using System.IO;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;

namespace HardcoreGame.Common.Systems
{
    public class DownedBossSystem : ModSystem
    {
        public static bool downedPumpkinBoy = false;
        public override void ClearWorld()
        {
            downedPumpkinBoy = false;
        }
        public override void SaveWorldData(TagCompound tag)
        {
            if (downedPumpkinBoy)
            {
                tag["downedPumpkinBoy"] = true;
            }
        }

        public override void LoadWorldData(TagCompound tag)
        {
            downedPumpkinBoy = tag.ContainsKey("downedPumpkinBoy");
        }

        public override void NetSend(BinaryWriter writer)
        {
            writer.WriteFlags(downedPumpkinBoy);
        }

        public override void NetReceive(BinaryReader reader)
        {
            reader.ReadFlags(out downedPumpkinBoy);
        }
    }
}
